<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DSN management: GNOME Data Access 5 manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GNOME Data Access 5 manual">
<link rel="up" href="gda-sql.html" title="Part VII. Gda SQL console's user manual">
<link rel="prev" href="ch39s03.html" title="Commands">
<link rel="next" href="gda-sql-manual-open.html" title="Connections management">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="gda-sql.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ch39s03.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gda-sql-manual-open.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="gda-sql-manual-dsn"></a>DSN management</h2></div></div></div>
<p>
    Named data sources (DSN) can be used (like in ODBC) to name some connections and define their connection parameters,
    it becomes easier to use them (one just has to remember the DSN name), and it becomes possible to change the 
    connection parameters without changing any code.
  </p>
<p>
    They can be listed using the <span class="command"><strong>.l</strong></span> command, and details about a DSN can be listed using the same command
    with the DSN name as argument:
    </p>
<pre class="programlisting">
gda&gt; .l
                              DSN list
DSN                  | Description                          | Provider  
---------------------+--------------------------------------+-----------
Bugzilla             | Bugzilla data source                 | MySQL     
koha                 |                                      | PostgreSQL
SalesTest            | Test database for a sales department | SQLite    
(3 rows)
gda&gt; .l SalesTest
                              DSN 'SalesTest' description
Attribute         | Value                                                                 
------------------+-----------------------------------------------------------------------
DSN               | SalesTest                                                             
Provider          | SQLite                                                                
Description       | Test database for a sales department                                  
Connection string | DB_DIR=/home/user/name/.libgda;DB_NAME=sales_test
Username          |                                                                       
Global            | FALSE                                                                 
(6 rows)
gda&gt;
    </pre>
<p>
  </p>
<p>
    The <span class="command"><strong>.lr DSN_NAME [DSN_NAME...]</strong></span> command removes the DSN listed as arguments, and the
    The <span class="command"><strong>.lc</strong></span> command creates (or modifies an existing) DSN, such as show:
    </p>
<pre class="programlisting">
gda&gt; .lc my_dsn PostgreSQL://DB_NAME=my_db;HOST=moon
gda&gt; .l my_dsn
        DSN 'my_dsn' description
Attribute         | Value                  
------------------+------------------------
DSN               | my_dsn                 
Provider          | PostgreSQL             
Description       |                        
Connection string | DB_NAME=my_db;HOST=moon
Username          |                        
Global            | FALSE                  
(6 rows)
gda&gt;
    </pre>
<p>
  </p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>